//package controller1;
//
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
//import com.wuchao.entity.User;
//import com.wuchao.service.serviceImpl.ServiceImpl;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.io.PrintWriter;
//import java.util.List;
//
///**
// * @Author wuchao66
// * @Date 2022/7/12 10:55
// * @Version 1.0
// */
//@WebServlet(name = "ServletPage1",urlPatterns = "/ServletPage1")
//public class ServletPage1 extends HttpServlet {
//        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
////乱码问题
//            request.setCharacterEncoding("utf-8");
//            response.setContentType("text/html;charset=utf-8");
//            //out对象
//            PrintWriter out = response.getWriter();//文件流
//            //刷新缓存区 关闭
//            out.flush();
//            out.close();
//        }
//        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//            //乱码问题
//            response.setCharacterEncoding("utf-8");
//            response.setContentType("text/html;charset=utf-8");
//            //out对象
//            PrintWriter out = response.getWriter();//文件流
//            //1开始分页设置
//            PageHelper.startPage(3,3);
//            List<User> poJo = new ServiceImpl().findPoJo("select * from user");
//            PageInfo<User> userPageInfo = new PageInfo<>(poJo);
//            //userPageInfo.getPages()
//          //
//            System.out.println(userPageInfo.getPageNum());
//            request.setAttribute("pageinfo",userPageInfo);
//            request.getRequestDispatcher("/pageinfo/page.jsp").forward(request,response);
//            out.flush();
//            out.close();
//
//        }
//}
